function [model]=r_nemo_cruise(dat,parameter,bbio,bbio_dir,year)  

% ---- Prof min
levmin=1;
% ---- Prof max
ncload('/media/disk/NEMO_OUTPUT/NATL4_mask.nc','nav_lev')
dmax=max(max(dat.depthdata));
levmax=find((dmax-nav_lev < 0),1,'first'); 
% premier indice ou la difference dmax - prof modele est negative 
% = first profondeur superieure a profondeur max

% -- Min/max lon/lat
ncload('/media/disk/NEMO_OUTPUT/NATL4_mesh_hgr.nc','glamt')
lomax=max(max(dat.londata));
lomin=min(min(dat.londata));
ncload('/media/disk/NEMO_OUTPUT/NATL4_mesh_hgr.nc','gphit')
lamax=max(max(dat.latdata));
lamin=min(min(dat.latdata));
[i,j]=find( (glamt <= lomax) & (glamt >= lomin) & (gphit <= lamax) & (gphit >= lamin)  );


switch parameter
    case 'T'
        gridtype='gridT';
        kind='T';
        [model.lon,model.lat,model.data,time_sec,time_txt,model.depth]=rnemo_3d_selec(bbio,bbio_dir,gridtype,kind,levmin,levmax,i,j,year);    
        model.depth=model.depth(levmin:levmax);
        % time_txt -> matlab time
        model.time=datenum(str2num(char(time_txt(:,2:5))),str2num(char(time_txt(:,7:8))),str2num(char(time_txt(:,10:11))));
    case 'S'
        gridtype='gridT';
        kind='S';
        [model.lon,model.lat,model.data,time_sec,time_txt,model.depth]=rnemo_3d_selec(bbio,bbio_dir,gridtype,kind,levmin,levmax,i,j,year);   
        model.depth=model.depth(levmin:levmax);        
        % time_txt -> matlab time
        model.time=datenum(str2num(char(time_txt(:,2:5))),str2num(char(time_txt(:,7:8))),str2num(char(time_txt(:,10:11))));
        
    case 'NO3'
        gridtype='ptrcT';
        kind='no3';
        [model.lon,model.lat,model.data,time_sec,time_txt,model.depth]=rnemo_3d_selec(bbio,bbio_dir,gridtype,kind,levmin,levmax,i,j,year);   
        model.depth=model.depth(levmin:levmax);        
        % time_txt -> matlab time
        model.time=datenum(str2num(char(time_txt(:,2:5))),str2num(char(time_txt(:,7:8))),str2num(char(time_txt(:,10:11))));

    case 'CHL'
        gridtype='ptrcT';
        kind='phy';
        [model.lon,model.lat,phy,time_sec,time_txt,model.depth]=rnemo_3d_selec(bbio,bbio_dir,gridtype,kind,levmin,levmax,i,j,year); 
        kind='zle';
        [model.lon,model.lat,zle,time_sec,time_txt,model.depth]=rnemo_3d_selec(bbio,bbio_dir,gridtype,kind,levmin,levmax,i,j,year);  
        kind='zlno3'; 
        [model.lon,model.lat,zlno3,time_sec,time_txt,model.depth]=rnemo_3d_selec(bbio,bbio_dir,gridtype,kind,levmin,levmax,i,j,year);     
        model.depth=model.depth(1:levmax);
        
    
        % Phytoplankton (mmolN.m-3) to Chlorophyll (mgChl.m-3) - variable
        % ratio
        interm(1:size(zle,1),1:size(zle,2),1:size(zle,3),1:size(zle,4))=1.;
        index=find(zle > zlno3);
        interm(index)=zlno3(index)./zle(index);
        interm(find(interm<0.31))=0.31;
        model.data=squeeze(1.59.*interm.*phy);
        
        % Constant ratio
        %model.data=1.59.*squeeze(phy);
        
        % time_txt -> matlab time
        model.time=datenum(str2num(char(time_txt(:,2:5))),str2num(char(time_txt(:,7:8))),str2num(char(time_txt(:,10:11))));            
    
end

